<template>
  <div class="hello">
    <transition name="fade" tag="ul" class="aa">
      <swiper :options="swiperOption">
        <swiper-slide style="width: 100%;" v-for="banner in banners" :key="banner.id">
          <img :src="banner.image" style="display: block;width: 100%">
        </swiper-slide>
        <!-- <swiper-slide style="width: 100%;">
          <img src="@/assets/home/bannerN1.jpg" style="width:100%; height:100%;display: block">
        </swiper-slide>
        <swiper-slide style="width: 100%;">
          <img src="@/assets/home/bannerN2.jpg" style="width:100%; height:100%;display: block">
        </swiper-slide>
        <swiper-slide style="width: 100%;">
          <img src="@/assets/home/bannerN3.png" style="width:100%; height:100%;display: block">
        </swiper-slide>
        <swiper-slide style="width: 100%;">
          <img src="@/assets/home/bannerN4.png" style="width:100%; height:100%;display: block">
        </swiper-slide>
        <swiper-slide style="width: 100%;">
          <img src="@/assets/home/bannerN5.png" style="width:100%; height:100%;display: block">
        </swiper-slide> -->
        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>
    </transition>
  </div>
</template>

<script>
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default {
  name: 'banner',
  data () {
    return {
      swiperOption: {
        // observer: true,
        // observeParents: true,
        // autoplay: true,
        autoplay: 2000,
        initialSlide: 0,
        loop: true,
        pagination: '.swiper-pagination',
        paginationClickable: true
      }
    }
  },
  props: {
    banners: {
      type: Array
    }
  },
  components: {
    swiper,
    swiperSlide
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .fade-enter-active, .fade-leave-active {
    transition: opacity .5s
  }
  .fade-enter, .fade-leave-active {
    opacity: 0
  }
</style>
